<div id="pageoptions">
    <%= link_to "new share request", {# link_to options
            :controller => 'sharing',
            :action => 'invite'} %>
</div><br/>
    <h2>Approved Partnerships With:</h2>
    <% for partner in @partners %>
        <div class="sectionwrap">
            <div class="sectiontitle">
                <%= "#{partner.first_name} #{partner.last_name} (#{partner.login})" %></div>
            <div class="sectionlinks">
                <ul>
                    <li><%= link_to "list shared user's stories", {# link_to options
                                    :controller => 'story',
                                    :action => 'authored_by_user',
                                    :id => partner.id } %></li>
                    <li><%= link_to "list user's shared words", {# link_to options
                                    :controller => 'word',
                                    :action => 'shared_words',
                                    :id => partner.id } %></li>
                    <li><%= link_to "stop sharing with user", {# link_to options
                                    :controller => 'sharing',
                                    :action => 'delete',
                                    :id => partner.id },
                                    { # html options
                                        :method => :post,
                                        :confirm => "Really stop sharing with #{partner.first_name}?"
                                    } %></li>
                </ul>
            </div>
        </div>
    <% end %>
    <% if @invitations.count > 0 %>
        <h2>Pending Sent Invitations To:</h2>
        <% for invitation in @invitations %>
            <div class="sectionwrap">
                <div class="sectiontitle">
                    <%= "#{invitation.first_name} #{invitation.last_name} (#{invitation.login})" %></div>
                <div class="sectionlinks">
                    <ul>
                        <li><%= link_to "resend share request", {# link_to options
                                        :controller => 'sharing',
                                        :action => 'resend',
                                        :id => invitation.id } %></li>
                    </ul>
                </div>
            </div>
        <% end %>
    <% end %>
    <h2>Pending Invitations From:</h2>
    <% for pending in @pending_invitations %>
        <div class="sectionwrap">
            <div class="sectiontitle">
                <%= "#{pending.first_name} #{pending.last_name} (#{pending.login})" %></div>
            <div class="sectionlinks">
                <ul>
                    <li><%= link_to "approve share request", {# link_to options
                                    :controller => 'sharing',
                                    :action => 'accept',
                                    :key => pending.security_token } %></li>                
                </ul>
            </div>
        </div>
    <% end %>